package com.woniuxy.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * @author Leimin
 * @date 2022/04/26 17:58
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value="客商模型")
public class Merchants {
    @ExcelProperty("id")
    private int id;

    @ExcelProperty("客商编码")
    @NotNull(message = "编码不能为空")
    @Pattern(regexp = "^[A-Za-z0-9]{4}$",message = "编码为4位数字、字母")
    @ApiModelProperty(value="客商编码")
    private String code;

    @ExcelProperty("客商名称")
    @NotNull(message = "名称不能为空")
    @Size(min=1, max=20, message="名称为1~20个字符")
    @ApiModelProperty(value="客商名称")
    private String name;

    @ExcelProperty("客商分类")
    @NotNull(message = "分类不能为空")
    @ApiModelProperty(value="客商分类")
    private String merchants_type;

    @ExcelProperty("客商简称")
    @ApiModelProperty(value="客商简称")
    private String short_name;

    @ExcelProperty("客商等级")
    @NotNull(message = "等级不能为空")
    @ApiModelProperty(value="客商等级")
    private String merchants_grade;

    @ExcelProperty("客商属性")
    @NotNull(message = "属性不能为空")
    @ApiModelProperty(value="客商属性")
    private String merchants_attribute;

    @ExcelProperty("客商行业")
    @NotNull(message = "行业不能为空")
    @ApiModelProperty(value="客商行业")
    private String merchants_industry;

    @ExcelProperty("联系人")
    @NotNull(message = "联系人不能为空")
    @ApiModelProperty(value="联系人")
    private String contacts;

    @ExcelProperty("电话")
    @NotNull(message = "电话不能为空")
    @Pattern(regexp = "^1[3456789]\\d{9}$",message = "电话号码不合法")
    @ApiModelProperty(value="电话")
    private String telephone;

    @ExcelProperty("传真")
    @ApiModelProperty(value="传真")
    private String fax;

    @ExcelProperty("邮箱")
    @Email(message = "邮箱无效")
    @ApiModelProperty(value="邮箱")
    private String email;

    @ExcelProperty("地址")
    @NotNull(message = "地址不能为空")
    @Size(min=1, max=50, message="地址为1~50个字符")
    @ApiModelProperty(value="地址")
    private String address;

    @ExcelProperty("国家")
    @ApiModelProperty(value="国家")
    private String country;

    @ExcelProperty("是否启用")
    @ApiModelProperty(value="是否启用")
    private int isEnable;

    @ExcelProperty("创建时间")
    private Date created_time;
    @ExcelProperty("创建人")
    private int created_userid;
    @ExcelProperty("修改时间")
    private Date last_modified_time;
    @ExcelProperty("修改人")
    private int last_modified_userid;
}

